package com.wr.modules.system.controller;

import com.wr.common.core.result.R;
import com.wr.modules.system.service.ISysConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author MyPC
 */
@Tag(name = "C - 系统配置接口")
@RestController
@RequestMapping("/sys-config")
public class SysConfigController {

    @Autowired
    private ISysConfigService iSysConfigService;

    @Operation(summary = "根据key获取配置")
    @GetMapping("/configValue/{configKey}")
    public R<String> configKey(@PathVariable("configKey") String configKey) {
        return R.ok(iSysConfigService.selectConfigByKey(configKey));
    }
}
